﻿<controls:ChildWindow xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="LEEAAttendanceControl.Views.EmployeeEdit"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           xmlns:my="clr-namespace:LEEAAttendanceControl.Web.Services"
           Width="479" Height="553" 
           Title="Employee Edit">
    <Grid x:Name="LayoutRoot" VerticalAlignment="Top">
        <sdk:TabControl HorizontalAlignment="Stretch" Margin="0,0,0,32" Name="tabControl1" VerticalAlignment="Stretch">
            <sdk:TabItem Header="Details" Name="tabItem1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

                <Grid HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" VerticalAlignment="Top" Name="GRDEmployee" 
                      DataContext="{Binding}" Margin="0,0,0,0">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition Width="56*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <sdk:Label Content="Company Name:" Grid.Column="0" Grid.Row="0" 
                       HorizontalAlignment="Left" 
                       Margin="10,10,10,10" 
                       VerticalAlignment="Center" />
                    
                    <ComboBox Grid.Column="1" Margin="10,11,0,0" Height="23" HorizontalAlignment="Left"
                              SelectedValue="{Binding CompanyID,Mode=TwoWay,ValidatesOnExceptions=True
                                              ,NotifyOnValidationError=True}" DisplayMemberPath="CompanyName"
                              SelectedValuePath="ID" Name="comboCompanies" VerticalAlignment="Top" Width="150" SelectionChanged="comboCompanies_SelectionChanged" />

                    <Image x:Name="MainImage" Grid.RowSpan="5" Grid.Column="2" Grid.Row="0" Width="150" HorizontalAlignment="Center" VerticalAlignment="Center"></Image>
                    <Button x:Name="UploadImage" Grid.Column="2" Grid.Row="5" Click="UploadImage_Click" Content="Image"></Button>

                    <sdk:Label Content="Department Name:" 
                       Grid.Column="0" Grid.Row="1" 
                       HorizontalAlignment="Left" 
                       Margin="10,10,10,10" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Grid.Row="1" Margin="10,10,10,10" Height="23" HorizontalAlignment="Left"  
                    SelectedValue="{Binding DepartmentID,Mode=TwoWay,ValidatesOnExceptions=True,NotifyOnValidationError=True}"
                   DisplayMemberPath="DepartmentName" 
                   SelectedValuePath="DepartmentID"
                   Name="comboDepartments" VerticalAlignment="Top" Width="150" />



                    <sdk:Label Content="Employee Code:" 
                       Grid.Column="0" 
                       Grid.Row="2" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="2" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtEmployeeCode" IsEnabled="False" 
                     Text="{Binding Path=EmployeeCode, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" Background="#FFD4E515" />

                    <sdk:Label Content="Card No:" 
                       Grid.Column="0" 
                       Grid.Row="3" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="3" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtCardNo" 
                     Text="{Binding Path=CardNo, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />


                    <sdk:Label Content="First Name:" 
                       Grid.Column="0" 
                       Grid.Row="4" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="4" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtFirstName" 
                     Text="{Binding Path=FirstName, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />
                    <sdk:Label Content="Last Name:" 
                       Grid.Column="0" 
                       Grid.Row="5" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="5" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtLastName" 
                     Text="{Binding Path=LastName, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />

                    <sdk:Label Content="Hire Date:" 
                       Grid.Column="0" 
                       Grid.Row="6" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <sdk:DatePicker Grid.Column="1" Grid.Row="6" Height="23" HorizontalAlignment="Left" Margin="10,7,0,0"   
                           SelectedDate="{Binding Path=EmploymentDate, 
                            Mode=TwoWay, TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                    Name="dpEmployeementDate" VerticalAlignment="Top" Width="150" />

                    <sdk:Label Content="Job" 
                       Grid.Column="0" 
                       Grid.Row="7" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />


                    <ComboBox Grid.Column="1" Grid.Row="7" Margin="10,10,10,10" Height="23" HorizontalAlignment="Left"  
                    SelectedValue="{Binding JobId,Mode=TwoWay,ValidatesOnExceptions=True,NotifyOnValidationError=True}"
                   DisplayMemberPath="JobName" 
                   SelectedValuePath="JobID"
                   Name="comboJobs" VerticalAlignment="Top" Width="150" />



                    <sdk:Label Content="Active:" 
                       Grid.Column="0" 
                       Grid.Row="8" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <CheckBox Grid.Column="1" Grid.Row="8" Content="Active" IsChecked="{Binding Active,Mode=TwoWay}" Margin="10,10,101,10" />

                   

                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Header="Additional Information" Name="tabItem2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" 
              VerticalAlignment="Top" Name="GRDEmployeeInfo" 
              DataContext="{Binding}" 
              Margin="0,0,0,0">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <sdk:Label Content="Address:" 
                       Grid.Column="0" 
                       Grid.Row="0" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="0" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtAddress"  
                     Text="{Binding Path=Address, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />


                    <sdk:Label Content="Phone:" 
                       Grid.Column="0" 
                       Grid.Row="1" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="1" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtPhone"  
                     Text="{Binding Path=Phone, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />

                    <sdk:Label Content="Mobile:" 
                       Grid.Column="0" 
                       Grid.Row="2" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="2" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtMobile"  
                     Text="{Binding Path=Mobile, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />

                    <sdk:Label Content="Birth Date:" 
                       Grid.Column="0" 
                       Grid.Row="3" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <sdk:DatePicker Grid.Column="1" Grid.Row="3" Height="23" HorizontalAlignment="Left" Margin="10,7,0,0"   
                            SelectedDate="{Binding Path=BirthDate, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                    Name="dpBirthDate" VerticalAlignment="Top" Width="150" />


                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Header="Logon Information" Name="tabItem3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" 
              VerticalAlignment="Top" Name="GRDEmployeeLogin" 
              DataContext="{Binding}" 
              Margin="0,0,0,0">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition Width="30*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <sdk:Label Content="User Name:" 
                       Grid.Column="0" 
                       Grid.Row="0" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <TextBox Grid.Column="1"  
                     Grid.Row="0" 
                     Height="23"  Margin="10,10,10,10"
                     HorizontalAlignment="Left" 
                     Name="txtLogin" 
                     Text="{Binding Path=Login, 
                            Mode=TwoWay, 
                            TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" 
                     Width="150" />

                    <sdk:Label Content="Password:" 
                       Grid.Column="0" 
                       Grid.Row="1" Margin="10,10,10,10" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />

                    <PasswordBox Grid.Column="1" Grid.Row="1"  Margin="10,10,10,10" Password="{Binding Path=Password, 
                            Mode=TwoWay, TargetNullValue='',ValidatesOnExceptions=True,NotifyOnValidationError=True}" Height="23" Width="150" Name="pbPassword" VerticalAlignment="Top" PasswordChar="*" />
                </Grid>
            </sdk:TabItem>
            <sdk:TabItem Header="Fingers Info" Visibility="Collapsed" Name="tabFingerInfo" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid HorizontalAlignment="Stretch" Grid.Row="1" Grid.Column="0" 
              VerticalAlignment="Top" Name="GRDFingersInfo" 
              DataContext="{Binding}" 
              Margin="0,0,0,0">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition Width="auto" />
                        <ColumnDefinition Width="227*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <sdk:Label Content="Location:" 
                       Grid.Column="0" 
                       Grid.Row="0" Margin="10,10,0,0" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Margin="10,10,0,0" Height="23" HorizontalAlignment="Left"
                             ItemsSource="{Binding}"
                              SelectedValue="{Binding LocationId,Mode=TwoWay,ValidatesOnExceptions=True
                                              ,NotifyOnValidationError=True}" DisplayMemberPath="Name"
                              SelectedValuePath="LocationId" Name="combolocations" VerticalAlignment="Top" Width="150" />
                    <sdk:Label Content="User Level:" 
                       Grid.Column="0" 
                       Grid.Row="1" Margin="10,10,0,0" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Grid.Row="1" Name="comboUserLevels"  Margin="10,10,0,0" Height="23" HorizontalAlignment="Left"
                         ItemsSource="{Binding}"
                         VerticalAlignment="Top" Width="150">
                        <ComboBoxItem Content="Normal"></ComboBoxItem>
                        <ComboBoxItem Content="Admin" ></ComboBoxItem>
                    </ComboBox>
                    <sdk:Label Content="Security Level:" 
                       Grid.Column="0" 
                       Grid.Row="2" Margin="10,10,0,0" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Grid.Row="2" Name="comboSecurityLevels"  Margin="10,10,0,0" Height="23" HorizontalAlignment="Left"
                        VerticalAlignment="Top" Width="150">
                        <ComboBoxItem Content="Default" />
                        <ComboBoxItem Content="Lowest" />
                        <ComboBoxItem Content="Lower" />
                        <ComboBoxItem Content="Normal" />
                        <ComboBoxItem Content="Higher" />
                        <ComboBoxItem Content="Highest" />
                    </ComboBox>
                    <sdk:Label Content="Card Type:" 
                       Grid.Column="0" 
                       Grid.Row="3" Margin="10,10,0,0" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Grid.Row="3" Name="comboCardType"  Margin="10,10,0,0" Height="23" HorizontalAlignment="Left"
                        VerticalAlignment="Top" Width="150">
                        <ComboBoxItem Content="Normal" />
                        <ComboBoxItem Content="Bypass" />
                    </ComboBox>
                    <sdk:Label Content="Auth Mode:" 
                       Grid.Column="0" 
                       Grid.Row="4" Margin="10,10,0,0" 
                       HorizontalAlignment="Left" 
                       VerticalAlignment="Center" />
                    <ComboBox Grid.Column="1" Grid.Row="4" Name="comboAuthMode"  Margin="10,10,0,0" Height="23" HorizontalAlignment="Left"
                        VerticalAlignment="Top" Width="150">
                        <ComboBoxItem Content="Disabled" />
                        <ComboBoxItem Content="Finger only" />
                        <ComboBoxItem Content="Finger and Password" />
                        <ComboBoxItem Content="Finger or Password" />
                        <ComboBoxItem Content="Password only" />
                        <ComboBoxItem Content="Card only" />
                    </ComboBox>
                <Button Grid.Column="0" Grid.Row="5" Name="btnsavefinger" Content="Save" Click="btnsavefinger_Click" />
                </Grid>
            </sdk:TabItem>
        </sdk:TabControl>
        <Button Content="Save" Margin="167,401,184,54" Click="SaveButton_Click" />
        <sdk:ValidationSummary Margin="0,425,0,-70" Height="122"/>

    </Grid>

</controls:ChildWindow>
